public class Go {
    public static void main(String[] args) {
        CellPhone p1 = new CellPhone();
        p1.testWork(new API() {
            @Override
            public int work(int n1, int n2) {
                return n1 + n2;
            }
        }, 10, 8);
    }
}

interface API {
    int work(int n1, int n2);
}

class CellPhone {
    public void testWork(API test, int n1, int n2) {
        int res = test.work(n1, n2);
        System.out.println("运算结果是" + res);
    }
}